package com.zjxmyq.authorization.controllers;

import com.zjxmyq.authorization.domain.Company;
import com.zjxmyq.authorization.service.CompanyService;
import com.zjxmyq.domain.result.RestResponse;
import jakarta.annotation.Resource;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class CompanyController {

    @Resource
    CompanyService companyService;
    @RequestMapping(value = "sign-company",method = RequestMethod.POST)
    public RestResponse signCompany(@RequestBody Company company){
        return RestResponse.success(
                companyService.signCompany(company)
        );
    }

    @RequestMapping(value = "update-company",method = RequestMethod.PUT)
    public RestResponse updateCompany(@RequestBody Company company){
        return RestResponse.success(
                companyService.updateCompany(company)
        );
    }

    @RequestMapping(value = "delete-company",method = RequestMethod.DELETE)
    public RestResponse deleteCompany(int id){
        return RestResponse.success(
                companyService.deleteCompany(id)
        );
    }
}
